Goal:

In this experiment I am observing a co-evolving population (survival is determined by a random draw) with a non-interactive trait. Newts and snakes have heritable traits, but their interaction is not determined by their phenotype. Instead, when newts and snakes interact, the outcome is determined by a coin flip. SLiM code changes: (1) prob_of_survive = runif(1); survive = runif(1) < prob_of_survive; //Things changes probably of snakes survival to 50%. If snake survives, newt dies. If snake dies, newt survives. Interaction not based on phenotypes

Questions:

What happens when a co-evolving trait is not interactive?

Background

In this experiment I keep everything about my simulation the same as GA1 tall (landscape size, fitness, cost, GA combinations, heritability) and change the interaction. Without the interaction of newts and snakes relying on their phenotype, there is no selection selecting for higher phenotypes. This experiment took away interspecific competition, but left in intraspecific competition (density dependent). I will explore how the lack of newt-snake phenotype dependent interaction affect newt/snake mean phenotype and spatial correlations. I predict that there will be no spatial phenotype correlation. I have no idea what to predict about the phenotypes.

## All cor, lit, and grid files exist!
## This program will now end!

Mean Phenotype Whole Simulation

This section explores how mutation rate with mutation effect size (GAs of newts and snakes) and the lack of newt-snake interaction affects newt and snake phenotypes over time. This figure has 16 GA combinations with four trials per combination. Mean newt phenotype is represented by the red lines, while mean snake phenotype is represented by the blue lines. The black lines is the difference between snake and newt mean phenotype. This section also has a table that states the average difference between snake and newt mean phenotypes from 100-50,000 generations.

Phenotype differences

Table of average Differences

##                    Group.1           x
## 1  1e-08_0.005_1e-08_0.005 -0.18729482
## 2   1e-08_0.005_1e-09_0.05  0.13976018
## 3    1e-08_0.005_1e-10_0.5  0.50759825
## 4      1e-08_0.005_1e-11_5  1.07418888
## 5   1e-09_0.05_1e-08_0.005 -0.11800217
## 6    1e-09_0.05_1e-09_0.05 -0.08351749
## 7     1e-09_0.05_1e-10_0.5  0.57878556
## 8       1e-09_0.05_1e-11_5  0.74688826
## 9    1e-10_0.5_1e-08_0.005 -0.61776623
## 10    1e-10_0.5_1e-09_0.05 -0.59585200
## 11     1e-10_0.5_1e-10_0.5  0.02503837
## 12       1e-10_0.5_1e-11_5  0.45853498
## 13     1e-11_5_1e-08_0.005 -0.97525745
## 14      1e-11_5_1e-09_0.05 -0.47443100
## 15       1e-11_5_1e-10_0.5 -0.42495875
## 16         1e-11_5_1e-11_5  0.04003739

Wow, this figure is really interesting. It is very mirrored across the diagonal. It seems like when there is a GA with more effect size variance the species’ phenotype drops (fairly quickly) to 0. The phenotypes of newts and snakes tend to stay around one or drop to 0. None of the phenotypes continuously increase. By looking at the table I see that the biggest difference in phenotype occurs when one species has a GA of 1e-11_5 and the other has a GA of 1e-08_0.005. I notices when GA were either the same or low (1e-08_0.005, 1e-09_0.05) the difference between snake and newt phenotype was small (~ 0.2 or lower). When the GA was high (1e-10_0.5, 1e-11_5) or further apart the difference between snake and newt phenotype was large (~ 0.43 or higher). Species with a higher mutational variance tended to have a lower mean phenotype. The difference in mutational variance lead to a positive or negative mean phenotype difference (when newts had a higher mutational variance the snake-newt mean phenotype difference was positive).

Connection between higher phenotype and population

The newt few figures check to see if there is a connection between population size and phenotype. The first figure compares the population size of newts and snake to the difference between mean snake and newt phenotype for a time slice (5,000-10,000 generations). Color in this plot represents the difference between snake and newt phenotype, with blue indicating snakes have a larger phenotype and red indicating newts have a larger phenotype. Cream color points indicate that the two phenotypes are nearly the same. The second figure present the histograms of the difference between snake and newt population size (green) and phenotype (purple) for a time slice (5,000-10,000 generations).

Phenotype differences

Phenotype & Populationsize differences

The Newt VS Snake Population Size figure is very symmetrical. The species that has a higher mutational variance tends to have a lower phenotype. This figure can also be read as: the species with a larger mutational effect size has a lower phenotype or the species with a higher mutation rate has a higher phenotype. This plot matches what I observed in the section above: when GA were either the same or low (1e-08_0.005, 1e-09_0.05) the difference between snake and newt phenotype was small & when the GA was high (1e-10_0.5, 1e-11_5) or further apart the difference between snake and newt phenotype was large. When looking at the phenotype and population size differences plots I noticed a few patterns. Going across the difference in phenotype size moves right (snakes have a larger population size), going down the difference in phenotype size moves left (newts have a larger population size). The population sizes say about the same. Population size is not connected to phenotype?

Correlation

The correlation section looks at how correlated newt and snake phenotypes are at a local level. The simulation map is divided into smaller grids, then the mean phenotype of newts and snakes is collected and a correlation value is calculated. The figure below shows the results of four trials for all 16 GA combinations. Snake mutation rate decreases while mutation effect size increase from left to right. Newt mutation rate decreases while mutation effect size increase from top to bottom. Newt and snake mutation rate and effect size are equal across the diagonal.

After looking at this figure, I can see that there is a range of correlation values. The correlation values can sometimes be positive, near 0, or negative. Some approach the real newt-snake correlation, which was unexpected. How often would newt and snake phenotypes be randomly correlated? How does individuals movements affect spatial correlation (my thought here: newts and snake phenotypes can become correlated if a newt and snake who live in a general vicinity both get a mutation that increases their fitness and the mutation spreads)? How does newt and snake interaction change correlation and the way a new mutation spreads?

Correlation Histograms

In order to understand how spatial correlations where changing with time I took 5,000 generation time slices to look at all four trials correlation values. Each color is a different trial per GA combination. The histogram values are stacked.

Plot 1

Plot 2

Plot 3

Plot 4

Plot 5

Plot 6

Plot 7

Plot 8

Plot 9

Plot 10

As I move through time chunks there is a lot of movement of spatial correlation values. Most correlation values are near 0, but a few become very correlated (both positive and negative). The most noticeable ones occur in the first group of four (A, B, E, F). I wonder if there is an even number of strong positive and negative correlation values (this would make it more of a random process).

Correlation across time

This next section examines how newt and snake mean phenotype (red and blue) and the newt-snake phenotype (pink) is correlated across time. There are three randomly chosen figures to represent the 16 GA combinations.

Random 1

## [1] "pattern 1e-08_0.005_1e-09_0.05_0"
## [1] "Cor between average snake pheno and local cor -0.400769653108568"
## [1] "Cor between average newt pheno and local cor -0.739632544823594"
## [1] "Cor between average dif pheno and local cor 0.727640129428969"
## [1] "Cor between newt pheno and snake 0.540668890892248"

Random 2

## [1] "pattern 1e-08_0.005_1e-08_0.005_1"
## [1] "Cor between average snake pheno and local cor -0.411411711184202"
## [1] "Cor between average newt pheno and local cor 0.49378324933247"
## [1] "Cor between average dif pheno and local cor -0.720149510215592"
## [1] "Cor between newt pheno and snake 0.222678563975846"

Random 3

## [1] "pattern 1e-11_5_1e-08_0.005_3"
## [1] "Cor between average snake pheno and local cor -0.0604535293455712"
## [1] "Cor between average newt pheno and local cor 0.14887064098596"
## [1] "Cor between average dif pheno and local cor -0.0936630967409948"
## [1] "Cor between newt pheno and snake -0.49201754752598"

In this simulation experiment, newt and snakes have an interaction not based on their phenotype. This reduces the section presser placed on newts and snakes in a co-evolutionary arms race. In each of these examples newt/snake mean phenotype(s) drop close to 0 or stay around one. Potentially, they either drop or stay at one due a combination of mutation effect size and phenotype cost. Theoretically, if there is a cost for having a higher phenotype and no benefit, the mean phenotype would decrease. However, the mean phenotype is more likely to decrease to zero is there is a larger mutation effect size or more mutational variance. The spatial correlation goes up and down, making me wonder why. There is no reason for there to be high correlation, but it can happen randomly. I wonder if the individuals might be moving around too much. I wonder what would happen on a larger map? It would be cool to look at the spread of different mutations with different GA through the map/grids. It would also be interesting to change the number of grids to see if it effects this correlation calculation.

What happens over time (looking at the beginning, middle, and late part of my simulations)

This next section is just getting a glimpse at how newt & snake phenotype and population size differ over time (beginning, middle, and end of my simulation). The populations start off with about 250 individuals each. Each individual has a different genetic background created from msprime. Plots show newt by snake population size, with the point color representing the difference between mean snake and newt phenotype. The other plots show histograms of difference between snakes and newts phenotype and population size (purple and green).

Pheno Beginning

Pheno Middle

Pheno End

Dif Beginning

Dif Middle

Dif End

As seen in some previous plots, results are very mirrored across the diagonal. It seems like which ever species has a higher mutational variance or higher mutational effect size had a lower phenotype (seen in both types of figures). The populations remained constant across GA combinations (both types of figures). After an initial population size increase, population sizes became steady (snakes had a higher population size, probably due to fitness advantage for randomly being successful in eating a newt).

Summary

In the summary section, I try to come up with a way to show how different GA combinations can change the simulations results. In all of these plots snakes GA is represented by color and newt GA is represented by shape. There 16 color-shape combinations (with 4 repeats for trials). There are four sets of plots: 1) newt by snake population size, 2) phenotype difference by snake population size, 3) phenotype difference by snake GA, and 4) phenotype difference by newt GA. There are three figures in each set, taken at the begging, middle, and end time chunks.

Early-Sim Population Size Summary

Mid-Sim Population Size Summary

Late-Sim Population Size Summary

Early Difference Summary

Mid Difference Summary

Late Difference Summary

By Snake GA (Early)

By Snake GA (Mid)

By Snake GA (Late)

By Newt GA (Early)

By Newt GA (Mid)

By Newt GA (Late)

After examining these plots I found that there is no relationship between GA and population size or population size and phenotype. However, there is an interaction between GA and phenotype blue/purple on the left and red/green on the right & (to a less noticeable degree) triangle/circle on the left and square/plus on the right (higher mutational variance lead to a lower phenotype). When looking at the by snake plot, GA newt GA is lined up from lowest mutation variance to highest mutational variance. This suggest that a higher newt variance led to a lower newt phenotype (possibly pushed down due to cost and no interaction). This pattern is reversed when looking at the plot of newt GA. On the newt GA plot, snake GA is lined up purple, blue, green, and red. This also indicates that a higher mutational variance led to a lower phenotype. This is really interesting!

Heatmap

This next sections shows the results of the previous section in a more condensed fashion. There are two types of plots. Each have newt GA on the x-axis and snake GA and trial number on the y-axis. The first plot set shows the snake population size, while the second plot set shows the difference between mean snake and newt phenotype.

Population Size (Early)

Population Size (Mid)

Population Size (Late)

Phenotype (Early)

Phenotype (Mid)

Phenotype (Late)

The results of this section how that there is no relationship between GA and population size (colors seem random). There is a ver noticeable relationship between GA and phenotype. Again, the difference in phenotype is symmetrical across the diagonal (right diagonal this time). Species have a higher phenotype is they have a GA with lower mutational variance. This might be due to the mutational effect size distribution and phenotype cost. What would change if I re-did this simulation and removed the cost? - I think that it is possible for the phenotypes to drift upwards

What is up with the correlations

This is the last results section. These are the results from the grid calculations. I divided my map up into smaller area (grids) and calculated mean phenotype, SD phenotype, max phenotype, min phenotype, and population size. In each of these plots newts are represented by circles and snakes are represented by squares. Parameter values increase from a dark color to a lighter color (green-blue themed for phenotype, orange-pinked themed for population size) There is also a subplot that plots each parameter (mean, sd…) of newt by snake colored by map location (red=corner, green=edge, blue=middle). I look at the some simulation at one time in the begging, middle, and end.

Early Simulation Correlation

Mean

## [1] 0.08941538

SD

## [1] -0.05684025

Max Phenotype

## [1] -0.05620503

Min Phenotype

## [1] -0.1811683

Population Size

## [1] -0.2839627

Middle Simulation Correlation

Mean

## [1] -0.2447956

SD

## [1] 0.2091648

Max Phenotype

## [1] -0.19622

Min Phenotype

## [1] 0.01225089

Population Size

## [1] 0.6059479

Late Simulation Correlation

Mean

## [1] 0.07210036

SD

## [1] 0.4470126

Max Phenotype

## [1] 0.241293

Min Phenotype

## [1] 0.08881336

Population Size

## [1] 0.440485

Extra

This is a bonus section showing how long my simulation took to get to certain generations